package com.wpre.springioc.component;

import com.wpre.springioc.model.UserInfo;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LianBao
 * Date: 2024-10-26
 * Time: 15:23
 */
@Component
public class UserComponent {
    //    @Autowired()
//    @Qualifier("UserInfo4")
//    private UserInfo userInfo;
//    public void f(){
//        System.out.println(userInfo);
//    }

    @Resource(name = "UserInfo4")
    private UserInfo userInfo;

    public void f() {
        System.out.println(userInfo);
    }
}
